package com.ssy.lingxi.order.model.vo.common.response;

import com.ssy.lingxi.common.constant.order.OrderPayChannelEnum;
import com.ssy.lingxi.common.constant.order.OrderPayTypeEnum;
import com.ssy.lingxi.order.model.constant.OrderServiceContants;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 售后能力 - 退货换货 - 订单支付记录
 * @author 万宁
 * @version 2.0.0
 * @date 2021-08-25
 */
public class OrderAfterSalePaymentDetailVO implements Serializable {
    private static final long serialVersionUID = -1217960333018321877L;

    public OrderAfterSalePaymentDetailVO(Long paymentId, LocalDateTime payTime, Integer batchNo, String payNode, BigDecimal payRate, BigDecimal payAmount, Integer fundMode, Integer payType, Integer payChannel, String tradeNo) {
        this.paymentId = paymentId;
        this.payTime = payTime == null ? "" : payTime.format(OrderServiceContants.DEFAULT_TIME_FORMATTER);
        this.batchNo = batchNo;
        this.payNode = payNode;
        this.payRate = payRate;
        this.payAmount = payAmount;
        this.fundMode = fundMode;
        this.payType = payType;
        this.payTypeName = OrderPayTypeEnum.getNameByCode(payType);
        this.payChannel = payChannel;
        this.payChannelName = OrderPayChannelEnum.getNameByCode(payChannel);
        this.tradeNo = tradeNo;
    }

    /**
     * 支付记录Id
     */
    private Long paymentId;

    /**
     * 支付时间，格式为yyyy-MM-dd HH:mm:ss
     */
    private String payTime;

    /**
     * 支付次数
     */
    private Integer batchNo;

    /**
     * 支付环节名称
     */
    private String payNode;

    /**
     * 支付比例
     */
    private BigDecimal payRate;

    /**
     * 支付金额
     */
    private BigDecimal payAmount;

    /**
     * 资金归集模式枚举
     */
    private Integer fundMode;

    /**
     * 支付方式枚举
     */
    private Integer payType;

    /**
     * 支付方式名称
     */
    private String payTypeName;

    /**
     * 支付渠道枚举
     */
    private Integer payChannel;

    /**
     * 支付渠道名称
     */
    private String payChannelName;

    /**
     * 在线支付的商户订单号（用于在线支付的退款）
     */
    private String tradeNo;

    public Long getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Long paymentId) {
        this.paymentId = paymentId;
    }

    public String getPayTime() {
        return payTime;
    }

    public void setPayTime(String payTime) {
        this.payTime = payTime;
    }

    public Integer getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(Integer batchNo) {
        this.batchNo = batchNo;
    }

    public String getPayNode() {
        return payNode;
    }

    public void setPayNode(String payNode) {
        this.payNode = payNode;
    }

    public BigDecimal getPayRate() {
        return payRate;
    }

    public void setPayRate(BigDecimal payRate) {
        this.payRate = payRate;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public Integer getFundMode() {
        return fundMode;
    }

    public void setFundMode(Integer fundMode) {
        this.fundMode = fundMode;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public String getPayTypeName() {
        return payTypeName;
    }

    public void setPayTypeName(String payTypeName) {
        this.payTypeName = payTypeName;
    }

    public Integer getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(Integer payChannel) {
        this.payChannel = payChannel;
    }

    public String getPayChannelName() {
        return payChannelName;
    }

    public void setPayChannelName(String payChannelName) {
        this.payChannelName = payChannelName;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }
}
